<template lang="jade">
h-loader-full(url='loader',:setdata='false')
  h-data-lister(data='list')
  .box
    m-title(icon='add',name='系统消息列表')
    //人员信息
    table.list
      ml-header(data='序号,消息,时间,操作')
      tr(v-for='(n,i) in list')
        td {{n.id}}
        td {{n.msg}}
        td {{new Date(n.time*1000).format('yyyy-MM-dd hh:mm:ss')}}
        td
          a(href='javascript:void(0)',class='remove',:data-index='i') 删除
    .command
      .page
        button(v-show='page>1', @click="pagego('last')") 上一页
        button {{page}}
        button(@click="pagego('next')") 下一页
        
     m-title(icon='add',name='欢迎消息列表')
    //人员信息
    table.list
      ml-header(data='序号,消息,时间,操作')
      tr(v-for='(n,i) in list_1')
        td {{n.id}}
        td {{n.msg}}
        td {{new Date(n.time*1000).format('yyyy-MM-dd hh:mm:ss')}}
        td
          a(href='javascript:void(0)',class='remove',:data-index='i') 删除
    .command
      .page
        button(v-show='page>1', @click="pagego('last')") 上一页
        button {{page}}
        button(@click="pagego('next')") 下一页
</template>
----------------------------------------------------------------------------------------
<script>
import { MessageBox } from 'mint-ui'
export default {
	data () {
		return {
			loader:{
        list:'swiper/msg_list',
        list_1:'swiper/msg_list_1'
        },
      url:{
        remove:'usermsg/remove'
      },
      list:[],
      page:1,
		}
	},
  mounted () {
    console.log(this.list_1)
  },
	methods: {
		loadAfter(data){
      this.list=data.list[0]
      this.list_1 = data.list_1[0]
		},
    // 分页
    pagego (type) {
      this.page = type == 'last' ? this.page - 1 : this.page + 1
      this.$ajax.get('swiper/msg_list?page=' + this.page, (res) => {
        this.list = res.data[0]
      }, (res) => {
        this.error(res.message)
      })
    },
	}
}
</script>
----------------------------------------------------------------------------------------
<style lang="less" scoped>
@import "../../../plugin/style/mixin";
.page{ float:right; }
  .page a{background: #4db3ff; color: #fff; padding:3px 10px; border-radius:4px; cursor:pointer;}
  .page b{margin:0 10px;}
</style>